package com.ll.blog.config;

import com.ll.blog.common.WordFilter;
import com.ll.blog.mapper.SensitiveWordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class BeanloadConfig {
    @Autowired
    SensitiveWordMapper wordMapper;
    @Bean
    public WordFilter wordFilter(){
        List<String> all = wordMapper.getAll();
        WordFilter wordFilter = new WordFilter();
        wordFilter.build(all);
        return wordFilter;
    }
}
